﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="code_edit.aspx.cs" Inherits="EDP.Application.Web.Code.code_edit" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
</head>
<body>
    <style type="text/css">
        .x-column-header {
            text-align: center;
        }
    </style>
    <form id="form1" runat="server">
        <f:PageManager ID="PageManager" AutoSizePanelID="panel_main" runat="server" />
        <f:HiddenField ID="hide_ruleId" runat="server" />
        <f:Panel ID="panel_main" Margin="0" BodyPadding="0" runat="server" ShowBorder="false" ShowHeader="false" AutoScroll="true" Layout="Region">
            <Items>
                <f:SimpleForm ID="form_content" runat="server" ShowBorder="false" ShowHeader="false" BodyPadding="10" RegionPosition="Top"
                    AutoScroll="false" Margin="0" LabelWidth="60" Layout="Column">
                    <Items>
                        <f:TextBox ID="tb_name" runat="server" Label="编码名称" BindName="Name" Margin="0" ColumnWidth="50%" ShowRedStar="true" />
                        <f:TextBox ID="tb_numbers" runat="server" Label="编码编号" BindName="Numbers" Margin="0 0 0 10" ColumnWidth="50%" ShowRedStar="true" EmptyText="1-20个字母或数字" />
                        <f:DropDownList ID="ddl_classify" runat="server" Label="所属分类" BindName="ClassifyId" EnableSimulateTree="true" ShowRedStar="true" Margin="10 0 0 0" ColumnWidth="50%" />
                        <f:TextBox ID="tb_currentValue" runat="server" Label="当前值" BindName="CurrentValue" Margin="10 0 0 10" ColumnWidth="50%" Readonly="true" />
                        <f:TextBox ID="tb_createUser" runat="server" Label="创建人" BindName="CreateUserName" Margin="10 0 0 0" ColumnWidth="50%" Readonly="true" />
                        <f:TextBox ID="tb_craeteTime" runat="server" Label="创建时间" BindName="CreateTimeDisplay" Margin="10 0 0 10" ColumnWidth="50%" Readonly="true" />
                        <f:TextBox ID="tb_modifyUser" runat="server" Label="修改人" BindName="ModifyUserName" Margin="10 0 0 0" ColumnWidth="50%" Readonly="true" />
                        <f:TextBox ID="tb_modifyTime" runat="server" Label="修改时间" BindName="ModifyTimeDisplay" Margin="10 0 0 10" ColumnWidth="50%" Readonly="true" />
                        <f:TextArea ID="tb_remark" runat="server" Label="描述" BindName="Remarks" Margin="10 0 0 0" ColumnWidth="100%" Height="80" />
                    </Items>
                </f:SimpleForm>
                <f:Grid ID="grid_ruleList" runat="server" ShowHeader="false" Margin="0 10 0 10" RegionPosition="Center" EnableCheckBoxSelect="false"
                    DataKeyNames="ID,TypeId,Format,InitialValue,Step" AllowSorting="false" AllowPaging="false"
                    OnRowCommand="grid_List_RowCommand">
                    <Toolbars>
                        <f:Toolbar runat="server" ToolbarAlign="Right">
                            <Items>
                                <f:Label ID="lb_title" runat="server" />
                                <f:ToolbarFill runat="server" />
                                <f:Button ID="btn_rule_add" runat="server" Text="添加规则" Icon="Add" Margin="0 10 0 0" OnClick="btn_rule_add_Click" />
                            </Items>
                        </f:Toolbar>
                    </Toolbars>
                    <Columns>
                        <f:BoundField ColumnID="col_Name" DataField="TypeName" ExpandUnusedSpace="true" HeaderText="规则类型" />
                        <f:BoundField ColumnID="col_Format" DataField="Format" ExpandUnusedSpace="true" HeaderText="格式" />
                        <f:BoundField ColumnID="col_InitialValue" DataField="InitialValue" Width="100" HeaderText="初始值" />
                        <f:BoundField ColumnID="col_Step" DataField="Step" Width="80" HeaderText="步长" />
                        <f:LinkButtonField ColumnID="lb_edit" Width="30" CommandName="edit" EnableLock="true" CommandTitle="编辑编码" Icon="TableEdit" TextAlign="center" ToolTip="编辑" />
                        <f:LinkButtonField ColumnID="lb_delete" Width="30" CommandName="delete" EnableLock="true" CommandTitle="删除规则" ToolTip="删除" Icon="Delete" TextAlign="center" />
                    </Columns>
                </f:Grid>
            </Items>
            <Toolbars>
                <f:Toolbar runat="server" Position="Bottom" ToolbarAlign="Right">
                    <Items>
                        <f:Button ID="btn_save" runat="server" Text=" 保 存 " Icon="Disk" Margin="0 10 0 0" OnClick="btn_save_Click" />
                        <f:Button ID="btn_close" runat="server" Text=" 关 闭 " Icon="Cross" Margin="0 10 0 0" EnablePostBack="false" />
                    </Items>
                </f:Toolbar>
            </Toolbars>
        </f:Panel>

        <f:Window ID="win_edit" runat="server" EnableIFrame="false" Layout="Fit">
            <Items>
                <f:SimpleForm ID="form_rule" runat="server" ShowBorder="false" ShowHeader="false" BodyPadding="10"
                    AutoScroll="false" EnableCollapse="false" Margin="0" LabelWidth="55" Layout="Column" ValidateRequestMode="Enabled">
                    <Items>
                        <f:DropDownList ID="ddl_ruleType" runat="server" Label="规则类型" Margin="0" ColumnWidth="100%" AutoPostBack="true" OnSelectedIndexChanged="ddl_ruleType_SelectedIndexChanged" />
                        <f:TextBox ID="tb_format" runat="server" Label="格式" Margin="10 0 0 0" ColumnWidth="100%" Hidden="true" />
                        <f:DropDownList ID="ddl_format" runat="server" Label="格式" Margin="10 0 0 0" ColumnWidth="100%" />
                        <f:NumberBox ID="tb_InitialValue" runat="server" Label="初始值" Margin="10 0 0 0" ColumnWidth="100%" />
                        <f:NumberBox ID="tb_Step" runat="server" Label="步长" Margin="10 0 0 0" ColumnWidth="100%" />
                    </Items>
                    <Toolbars>
                        <f:Toolbar runat="server" Position="Bottom" ToolbarAlign="Right">
                            <Items>
                                <f:Button ID="btn_rule_save" runat="server" Text=" 保 存 " Icon="Disk" Margin="0 10 0 0" ValidateForms="form_rule" OnClick="btn_rule_save_Click" />
                                <f:Button ID="btn_rule_close" runat="server" Text=" 关 闭 " Icon="Cross" Margin="0 10 0 0" EnablePostBack="false" EnablePermission="false" />
                            </Items>
                        </f:Toolbar>
                    </Toolbars>
                </f:SimpleForm>
            </Items>
        </f:Window>
    </form>
</body>
</html>
